// 1 提供超类型|父类型
function SuperClass(name) {
  this.name = name;
  this.showName = function () {
    console.log(this.name);
  }
}

// 2 设置父类型的原型属性和原型方法
SuperClass.prototype.info = 'SuperClass的信息';
SuperClass.prototype.showInfo = function () {
  console.log(this.info);
};

// 3 提供子类型
function SubClass(name) {
  SuperClass.call(this, name);
}

// 获取父构造函数的实例成员  Person.call(this,name);
// 获取父构造函数的原型成员  SubClass.prototype = SuperClass.prototype;
SubClass.prototype = SuperClass.prototype;
SubClass.prototype.constructor = SubClass;

var sub_one = new SubClass("zhangsan");
var sub_two = new SubClass("lisi");
console.log(sub_one);
console.log(sub_two);
